<template>
  <div id="app">
    <ul>
      <li v-for="(item, index) in myArr" :key="index"> {{ item }} </li>
    </ul>
    <button @click="btn">走一走</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      myArr: ["帅哥", "美女", "程序猿"],
    };
  },
  methods: {
    btn() {
      // 头部数据加入到末尾
       let sum = this.myArr.shift()
      // 再把头部的数据删除掉
      this.myArr.push(sum)
    },
  },
};
</script>

<style>
</style>
